package com.huatai.datadevelop.controller;

import com.huatai.common.api.R;
import com.huatai.datadevelop.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @Author zhangbenting
 * @Description TODO
 * @Date 2023/9/20 15:06
 * @Version 1.0
 */
@RestController
@RequestMapping("/sys/common")
public class CommonController {
	@Autowired
	private CommonService commonService;


	/**
	 * 获取系统支撑的请求头参数
	 */
	@GetMapping("/getContentTypeList")
	public R contentTypeList(){
		List<String> contentTypeList = commonService.getContentTypeList();
		return R.data(contentTypeList);
	}

	/**
	 * 获取系统可以支撑的请求方式
	 */
	@GetMapping("/getRequestMethodList")
	public R requestMethodList(){
		List<String> contentTypeList = commonService.getRequestMethodList();
		return R.data(contentTypeList);
	}

	/**
	 * 获取系统名称
	 * @param title
	 * @return
	 */
	@GetMapping("/getTitleValue/{title}")
	public R getTitleValue(@PathVariable("title") String title){
		return R.data(commonService.getTitleValue(title));
	}
}
